﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using S4Store.Domain;
using S4Store.Domain.FinancialKpi;

namespace S4Store.Models.FinancialKpi
{
    public class InputFinancialKpiDayDataModel
    {
        public List<CarBrand> CarBrands { get; set; }
        public List<FinancialDayData> DayDatas { get; set; }
        public DateTime Date { get; set; }
        public List<FinancialCarBrandMonthConfig> MonthConfigs { get; set; }

        public FinancialDayData GetDayData(int carbrandid)
        {
            var data = DayDatas.FirstOrDefault(t => t.CarBrandId == carbrandid);
            if (data == null)
            {
                data = new FinancialDayData();
                data.Date = Date;
            }

            var carmodelconfig = MonthConfigs.FirstOrDefault(t => t.CarBrandId == carbrandid);
            
            return data;
        }

        public bool IsConfirmed { get; set; }
    }
}